#include "method_test.h"

jstring invokeStaticMethod(JNIEnv *env, jobject obj, jstring str) {
    jclass clazz = env->GetObjectClass(obj);
    jmethodID mid = env->GetStaticMethodID(clazz, "staticMethod",
                                           "(Ljava/lang/String;)Ljava/lang/String;");
    return (jstring) env->CallStaticObjectMethod(clazz, mid, str);
}



jint invokeMethod(JNIEnv *env, jobject obj, jint a, jint b) {
    jclass clazz = env->GetObjectClass(obj);
    jmethodID mid = env->GetMethodID(clazz, "method",
                                           "(II)I");
    return env->CallIntMethod(obj, mid, a, b);
}

